# Contributor: Bhushan Shah <bshah@kde.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=libphonenumber
pkgver=8.12.8
pkgrel=0
pkgdesc="Library for parsing, formatting, and validating international phone numbers."
url="https://github.com/googlei18n/libphonenumber"
arch="all"
license="Apache-2.0"
depends_dev="boost-dev protobuf-dev icu-dev"
makedepends="$depends_dev cmake gtest-dev"
checkdepends="gtest"
subpackages="$pkgname-static $pkgname-dev"
source="https://github.com/googlei18n/libphonenumber/archive/v$pkgver/libphonenumber-v$pkgver.tar.gz"

build() {
	cd cpp
	cmake -B build \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	cd cpp
	./build/libphonenumber_test
}

package() {
	cd cpp
	DESTDIR="$pkgdir" cmake --build build --target install
}

sha512sums="5bead77c4b9d57e6f59313dd97244f70bbb67375152b6f2eb784b1718e55f74788c30140f8d42399c430bb19d0ae8af54479269ab34525d836a9b8ab37b7e69c  libphonenumber-v8.12.8.tar.gz"
